\section{Introduction}
\label{sec:intro}
Any industrial-level programming language needs some kind of input/output (I/O) mechanism.
Different languages take different approaches to handling this.
In C a \texttt{FILE} object (struct) is used to identify a stream which can be written to or read from by the functions \texttt{fprintf} or \texttt{fscanf} respectively (other functions exist as well).
Since C does not support object oriented programming it is not trivial to make a new type of stream to be used with the same function, in fact it is suggested that only functions from that standard library are used to access a \texttt{FILE}~\cite{cFILE}.
C\# uses streams as well, but inheritance can be used to make specific types of user-defined streams and/or formatting of types.
New methods can also be added through extension methods to support I/O of new user defined types.
Haskell takes quite another approach and uses monads~\cite{haskellMonads}.
This is due to Haskell being a purely functional language and I/O might indeed result in side effects.
Monads enables Haskell to exhibit pure behavior internally, while still allowing to perform e.g. writes to a file.

C++, as I am concerned with in this essay, is using streams as C and C\#, but instead of relying on inheritance of streams operator overloading is used.
In particular the operators $<<$ (put to) and $>>$ (get from) are used to put an object of some type into a stream or get it out respectively~\cite{stroustrup2000}.

In \secref{sec:streams} I present some general knowledge about streams in C++ along with a few peculiarities which I have discovered.
A more comprehensive comparison than already performed between streams in C++ and in C\# is presented in \secref{sec:comp}.
Finally in \secref{sec:prog} I present a program where I perform non-trivial formatting on integers, such as printing it in other bases than 8, 10, and, 16 as is the only possibility in the standard library~\cite{fmtflags}.